import time

from selenium.webdriver.common.by import By

from Base import Base
from Page import Page


class Page2(Page):
    loc_username=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[1]/div/input')
    def username(self):
        self.send_keys(self.loc_username,'hzy')
    loc_password=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[2]/div/input')
    def password(self):
        self.send_keys(self.loc_password,'123')
    loc_login=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/button[2]')
    def login(self):
        self.click(self.loc_login)
    loc_que=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[2]/div/div/div/div[2]/button[2]/span')
    def que(self):
        self.click(self.loc_que)
    loc_del=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[1]/div[1]/div[3]/div/div[1]/div/table/tbody/tr[3]/td[6]/div/i[2]')
    def dele(self):
        self.click(self.loc_del)




    def luoji_del(self):
        self.open_url('http://localhost:8080/yklogin3')
        self.username()
        self.password()
        self.login()
        self.que()
        time.sleep(3)
        self.dele()